﻿using UnityEngine;
using System.Collections;

public class GridCell : MonoBehaviour {
	public Vector2 boardPosition;
	public bool walkable;
	public int gValue;
	public int hValue;
	public int fValue;
	public GridCell parentGridCell;
	
	// Use this for initialization
	void Start () {
		fValue = 9001;
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	//sets this grid cell as the players destination grid cell whenever it is clicked.
	void OnMouseDown(){
		GameController.gc.setPlayerTarget(boardPosition, this);
	}
	//constructor
	public GridCell(){

	}
	//test to see if two grid cells are equal.
	public static bool areEqual(GridCell node1, GridCell node2){
		if(node1 == null || node2 == null)
			return false;
		if(node1.boardPosition.x==node2.boardPosition.x && node1.boardPosition.y==node2.boardPosition.y){
			return true;
		}
		return false;
	}
}
